import com.future.User

class LoginService {

    boolean transactional = true
    static scope="session"
    def userInstance
    def String login(def params){
       userInstance=new User(params)
       if(params.userName==null ||params.password==null||params.userName==""||params.password==""){
         return "login.empty"
       }else{
         if(User.countByUserName(params.userName)==1){
           if(User.countByPassword(params.password)==1){
             return "true"
           }else{
             return "login.password.error"
           }
         }else{
           return "login.name.error"
         }
     }
    }
}
